package work20241203_chap6oop.b_extends;

/**
 * @author zdl
 * @date 2024/12/3
 */
public class Demo {
    public static void main(String[] args) {
        Son son = new Son();
//        son.name = "李四";
//        son.setHobby("打游戏");
//        System.out.println(son.name);
//        System.out.println(son.getHobby());
//        son.eat();
//
//        Child child = new Child();
//        child.name = "孙子";
//        child.setHobby("打豆豆");
//        System.out.println(child.name);
//        System.out.println(child.getHobby());
//        child.eat(); //继承Son类eat方法
    }
}
